//
//  GoodsDetailSelectSkuPopViewTopView.m
//  ABSallRec
//
//  Created by 我演示 on 2019/11/14.
//  Copyright © 2019 Jerry-Fu. All rights reserved.
//

#import "GoodsDetailSelectSkuPopViewTopView.h"


@interface GoodsDetailSelectSkuPopViewTopView ()

/**UIImageView*/
@property(nonatomic,weak) UIImageView *iconImage ;

/**价格标签*/
@property(nonatomic,weak) UILabel *priceLabel ;

/**库存信息*/
@property(nonatomic,weak) UILabel *repertoryLabel ;

/**选择尺寸信息*/
@property(nonatomic,weak) UILabel *propertyLabel ;

@end

@implementation GoodsDetailSelectSkuPopViewTopView

-(instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self makeUpUI];
        [self makeUpSubviews];
    }
    return  self;
}

-(void)makeUpUI{
    //1 : UIImageview
    UIImageView *iconImageView = [[UIImageView alloc] init];
    iconImageView.image = [UIImage imageNamed:@"goodsShow_good"];
    [self addSubview:iconImageView];
    self.iconImage = iconImageView;
    
    //2: priceLabel
    UILabel *priceLabel = [[UILabel alloc] initWithTextString:@"价格18" andTextColor:[UIColor colorWithHexString:@"#000000"] andTextFont:15];
    priceLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:15];
    [self addSubview:priceLabel];
    self.priceLabel = priceLabel;
    
    //3：库存label
    UILabel *repertoryLabel = [[UILabel alloc] initWithTextString:@"库存四十" andTextColor:[UIColor colorWithHexString:@"#666666"] andTextFont:12];
    repertoryLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:12];
    [self addSubview:repertoryLabel];
    self.repertoryLabel = repertoryLabel;

    
    //4:选择尺码label
    UILabel *propertyLabel = [[UILabel alloc] initWithTextString:@"选择尺码" andTextColor:[UIColor colorWithHexString:@"#333333"] andTextFont:12];
    propertyLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:12];
    [self addSubview:propertyLabel];
    self.propertyLabel = propertyLabel;
    
    
}

-(void)makeUpSubviews {
    // iconimageView
    [self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self).mas_offset(12);
        make.width.height.offset(104);
    }];
    
    //priceLabel
    [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconImage.mas_right).offset(10);
        make.top.equalTo(self.mas_top).offset(24);
        make.height.offset(20);
        make.right.equalTo(self.mas_right).offset(0);
        
    } ];
    
    //库存
    [self.repertoryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.priceLabel.mas_left).offset(0);
        make.top.equalTo(self.priceLabel.mas_bottom).offset(11);
        make.right.equalTo(self.mas_right).offset(0);
        make.height.offset(15);
    }];
    
    /// 选择尺码
    [self.propertyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.priceLabel.mas_left).offset(0);
        make.top.equalTo(self.repertoryLabel.mas_bottom).offset(10);
        make.height.offset(15);
        make.right.equalTo(self.mas_right).offset(0);
    } ];
    
}

@end
